﻿
/*----------------------------------------------------------------//
// 文件名：MoTfile.cs
// 文件功能描述：实体 MoTfile.
// 
// 创建标识：2009-03-10
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoTfile
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoTfile
	/// </summary>
	public partial class MoTfile:ICloneable
	{
		#region 表Tfile的字段
		private string _file_id;
		private long _file_length;
		private string _file_url;
		private string _file_name;
		private DateTime _file_create_time;
		#endregion
		
		#region 构造函数
		public MoTfile()
		{
		    
		    
		    
		    
		    _file_create_time= DateTime.Now;
		}
		#endregion
		
		#region 拷贝构造函数

		public MoTfile(MoTfile item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoTfile(string file_id,long file_length,string file_url,string file_name,DateTime file_create_time)
		{
		this._file_id=file_id;
		this._file_length=file_length;
		this._file_url=file_url;
		this._file_name=file_name;
		this._file_create_time=file_create_time;
		}
		#endregion
		
		#region 表Tfile的字段属性
		/// <summary>
		/// FILE_ID
		/// </summary>
		public string File_Id
		{
			get {return _file_id;}
			set {_file_id=value;}
		}
		/// <summary>
		/// FILE_LENGTH
		/// </summary>
		public long File_Length
		{
			get {return _file_length;}
			set {_file_length=value;}
		}
		/// <summary>
		/// FILE_URL
		/// </summary>
		public string File_Url
		{
			get {return _file_url;}
			set {_file_url=value;}
		}
		/// <summary>
		///不含目录，包括扩展名
		/// </summary>
		public string File_Name
		{
			get {return _file_name;}
			set {_file_name=value;}
		}
		/// <summary>
		/// FILE_CREATE_TIME
		/// </summary>
		public DateTime File_Create_Time
		{
			get {return _file_create_time;}
			set {_file_create_time=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoTfile CopyTo(MoTfile item)
        {
		    item.File_Id=this.File_Id;
		    item.File_Length=this.File_Length;
		    item.File_Url=this.File_Url;
		    item.File_Name=this.File_Name;
		    item.File_Create_Time=this.File_Create_Time;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoTfile NewTfile=new MoTfile();
		    NewTfile._file_id=this._file_id;
		    NewTfile._file_length=this._file_length;
		    NewTfile._file_url=this._file_url;
		    NewTfile._file_name=this._file_name;
		    NewTfile._file_create_time=this._file_create_time;
			return NewTfile;
		}
		
		private static MoTfile _empty = new MoTfile(string.Empty,-1,string.Empty,string.Empty,DateTime.MinValue);
        public static MoTfile Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoTfile NewTfile = obj as MoTfile;
                if (NewTfile == null)
                {
                    return false;
                }
                else
                {
				if (NewTfile.File_Id==this.File_Id && NewTfile.File_Length==this.File_Length && NewTfile.File_Url==this.File_Url && NewTfile.File_Name==this.File_Name && NewTfile.File_Create_Time==this.File_Create_Time)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("File_Id={0}/File_Length={1}/File_Url={2}/File_Name={3}/File_Create_Time={4}",_file_id,_file_length,_file_url,_file_name,_file_create_time);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["File_ID"]!=null && row["File_ID"]!=DBNull.Value)
			{
			    this.File_Id = (string)row["File_ID"];
			}
			else
			{
				this.File_Id =string.Empty;
			}
		    if(row["File_Length"]!=null && row["File_Length"]!=DBNull.Value)
			{
			    this.File_Length = (long)row["File_Length"];
			}
			else
			{
				this.File_Length =-1;
			}
		    if(row["File_URL"]!=null && row["File_URL"]!=DBNull.Value)
			{
			    this.File_Url = (string)row["File_URL"];
			}
			else
			{
				this.File_Url =string.Empty;
			}
		    if(row["File_Name"]!=null && row["File_Name"]!=DBNull.Value)
			{
			    this.File_Name = (string)row["File_Name"];
			}
			else
			{
				this.File_Name =string.Empty;
			}
		    if(row["File_Create_Time"]!=null && row["File_Create_Time"]!=DBNull.Value)
			{
			    this.File_Create_Time = (DateTime)row["File_Create_Time"];
			}
			else
			{
				this.File_Create_Time =DateTime.MinValue;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["File_ID"] = this.File_Id;
			row["File_Length"] = this.File_Length;
			row["File_URL"] = this.File_Url;
			row["File_Name"] = this.File_Name;
			row["File_Create_Time"] = this.File_Create_Time;
		}
		#endregion
	}
}
#endregion
